import pandas as pd
df = pd.read_csv("/Users/chenyunqing/Documents/QTM350/QTM350HW5-cyq/wdi.csv")
df = df.dropna(subset=['life_expectancy', 'gdp_per_capita', 'country', 'gdp_growth_rate'])
highest_life_expectancy = df['life_expectancy'].max()
highest_life_expectancy_idx = df['life_expectancy'].idxmax()
country_highest_life_expectancy = df.loc[highest_life_expectancy_idx, 'country']
gdp_per_capita_country_highest_life_expectancy = df.loc[highest_life_expectancy_idx, 'gdp_per_capita']
gdp_growth_rate_country_highest_life_expectancy = df.loc[highest_life_expectancy_idx, 'gdp_growth_rate']
highest_gdp_per_capita = df['gdp_per_capita'].max()
highest_gdp_per_capita_idx = df['gdp_per_capita'].idxmax()
country_highest_gdp_per_capita = df.loc[highest_gdp_per_capita_idx, 'country']
life_expectancy_country_highest_gdp_per_capita = df.loc[highest_gdp_per_capita_idx, 'life_expectancy']
gdp_growth_rate_country_highest_gdp_per_capita = df.loc[highest_gdp_per_capita_idx, 'gdp_growth_rate']
display(highest_life_expectancy)
display(country_highest_life_expectancy)
display(gdp_per_capita_country_highest_life_expectancy)
display(gdp_growth_rate_country_highest_life_expectancy)
display(highest_gdp_per_capita)
display(country_highest_gdp_per_capita)
display(life_expectancy_country_highest_gdp_per_capita)
display(gdp_growth_rate_country_highest_gdp_per_capita)85.377
'Macao SAR, China'
36909.9564090312
-19.6093363742205
125006.021815486
'Luxembourg'
83.0463414634146
1.38018589083207